<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <h2>v-html 指令</h2>
        <div  v-html="html"></div>
        <h2>v-on 指令</h2>
        <h4>click 事件</h4>
        <button  v-on:click="onClick(count,'msg')">{{text}}</button>
        <h4>鼠标移入移出事件</h4>
        <button  v-on:mouseover="onMouseover" v-on:mouseout="onMouseout">
            <span>{{mouseText}}</span>
        </button>
    </div>
</body>
<script src="./min-vue/dep.js"></script>
<script src="./min-vue/watcher.js"></script>
<script src="./min-vue/compiler.js"></script>
<script src="./min-vue/observer.js"></script>
<script src="./min-vue/vue.js"></script>
<script>
    let vm = new Vue({
      el: '#app',
      data: {
          msg: 'hello',
          count: 100,
          person: {
              name: 'Lisa',age: 12
          },
          text: '请点击我',
          html:`<div>
               <h2>render v-html</h2>
            </div>`,
            mouseText: '请将鼠标移动到此按钮'
      },
      methods:{
        onClick(count,msg) {
            this.text = '我被点击了'
            alert(`接收到数据count:${count},msg:${msg}`)
        },
        onMouseover() {
            this.mouseText = '鼠标移入'
        },
        onMouseout() {
            this.mouseText = '鼠标移出'
        },
      }
    })

</script>
</html>